<?php

declare (strict_types=1);

namespace app\services\notice;

use app\services\BaseServices;
use app\dao\notice\UserNoticeDao;

/**
 *
 * Class StoreCartServices
 * @package app\services\notice
 */
class UserNoticeServices extends BaseServices
{

    /**
     * StoreCartServices constructor.
     * @param UserNoticeDao $dao
     */
    public function __construct(UserNoticeDao $dao)
    {
        $this->dao = $dao;
    }

    /**
     * 获取某个用户下的消息
     * @param int $uid
     * @return array
     */
    public function getUserNotice(int $uid)
    {
        return $this->dao->getUserNotice($uid);
    }

    /**
     * @param array $data
     * @return mixed
     */
    public function setNotice(array $data)
    {
        $data['add_time'] = time();
        return $this->dao->save($data);
    }
}
